/**
 * JAVACC DEMO 1.0
 * @copy right dwusoft company All rights reserved. 
 * @Package com.zbxsoft.utr.service.plugins  
 */
package com.apache.bid.service.adminplugins;

import org.apache.log4j.Logger;

import com.apache.api.vo.ParamsVo;
import com.apache.api.vo.ResultEntity;
import com.apache.bid.common.BidCommonUtil;
import com.apache.bid.common.Constant;
import com.apache.bid.service.plugins.UnityContinueSessionPluginImpl;
import com.apache.cache.util.Validator;
import com.apache.rpc.client.RpcProtoclClient;

/**
 * description:  继续启用item，
 * @author xhe 创建时间：2016-03-21  
 * 
 */
public class ContinueSessionPluginImpl extends UnityContinueSessionPluginImpl {
	private Logger log = Logger.getLogger(getClass());

	public Object execute(ParamsVo pvo) throws Exception {
		ResultEntity ret = new ResultEntity();
		if (Constant.getInstance().ifWriteDatabase()) {
			ret = (ResultEntity) super.execute(pvo);
		} else {
			if (Validator.isNotNull(pvo.getInfoId())) {
				pvo.setParams("infoId", pvo.getInfoId());
			}
			pvo.setParams("infoId", pvo.getInfoId());
			ret = RpcProtoclClient.getInstance().doService("wbdCacheService", "continueSession", pvo.getParams(),
					BidCommonUtil.getInstance().getInterfaceRegister("", ""));
			log.info("result=" + ret.getResult() + ";msg=" + ret.getMessage());
		}
		return ret;
	}

}
